<?php $title_show = empty ($datacontent['id'])?"Add":"Edit"; ?>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>public/skin/back-end/css/chantable.css"/>
<h1>Products Management <span class="greysubheading"><?php echo $title_show; ?></span></h1>

<form id="news-form" action="" method="POST" enctype="multipart/form-data" name="form">
<div id="c_wapper">
    <fieldset ><legend>Field:</legend>
        <table>
            <tbody>
<?php echo textfield('name','Name',((array_key_exists('name', $datacontent))?$datacontent['name']:null))?>
<?php // echo textfield('product_code','Product Code',((array_key_exists('product_code', $datacontent))?$datacontent['product_code']:null))?>
<?php echo textfield('price','Price',((array_key_exists('price', $datacontent))?$datacontent['price']:null))?>
<?php echo textfield('alias','Alias',((array_key_exists('alias', $datacontent))?$datacontent['alias']:null))?>
<?php echo dropdown('category_id','Category',$cattree,((array_key_exists('category_id', $datacontent))?$datacontent['category_id']:null))?>
<?php echo richtext('description','Description',((array_key_exists('description', $datacontent))?$datacontent['description']:null))?>
<?php echo richtext('note','Note',((array_key_exists('note', $datacontent))?$datacontent['note']:null))?>
<?php echo array_key_exists('order', $datacontent) ? dropdown('order','Order',$total_item,((array_key_exists('order', $datacontent))?$datacontent['order']:null)): ""?>
<?php echo image('images','Images',((array_key_exists('images', $datacontent))?$datacontent['images']:null))?>
<?php echo dropdown('onhome' , "Show on home page", array('0'=>'Off','1'=>'On'), ((array_key_exists('onhome', $datacontent))?$datacontent['onhome']:null))?>
<?php echo dropdown('is_no_sale' , "La TB SX", array('0'=>'No','1'=>'Yes'), ((array_key_exists('is_no_sale', $datacontent))?$datacontent['is_no_sale']:null))?>
<?php echo dropdown('showtype' , "Show type", array('0'=>'Show','1'=>'Not Show'), ((array_key_exists('showtype', $datacontent))?$datacontent['showtype']:null))?>
<?php echo dropdown('hot_item' , "Hot Item", array('0'=>'No','1'=>'Yes'), ((array_key_exists('hot_item', $datacontent))?$datacontent['hot_item']:null))?>
            </tbody>
        </table>
    </fieldset>
  <table>
        <tr>
          <td>
              <button type="submit" id="button">Edit</button>
              <button type="reset" id="reset" onClick="location.reload(true)" id="button">Reset</button>
          </td>
        </tr>
  </table>
</div>
</form>